package com.aidex.business.service.impl;

import com.aidex.business.domain.BCategory;
import com.aidex.business.mapper.BCategoryMapper;
import com.aidex.business.service.BCategoryService;
import com.aidex.common.core.domain.TreeNode;
import com.aidex.common.core.service.BaseServiceImpl;
import com.aidex.common.core.service.BaseTreeServiceImpl;
import com.alibaba.fastjson2.JSONObject;
import org.mybatis.logging.Logger;
import org.mybatis.logging.LoggerFactory;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * 商品类目表Service业务层处理
 * @author 1205560870@qq.com
 * @email 1205560870@qq.com
 * @date 2025-03-10
 */
@Service
public class BCategoryServiceImpl extends BaseTreeServiceImpl<BCategoryMapper, BCategory> implements BCategoryService {
    private static final Logger log = LoggerFactory.getLogger(BCategoryServiceImpl.class);
    @Override
    public List<BCategory> listDataByLevel(int level, String parentId) {
        List<BCategory> listData = new ArrayList<BCategory>();
        level--;
        List<BCategory> childrenList = findChildListByParentId(parentId);
        for (BCategory dto : childrenList) {
            if ("n".equals(dto.getTreeLeaf()) && level > 0) {
                dto.setChildren(this.listDataByLevel(level, dto.getId()));
            } else {
                dto.setChildren(new ArrayList<>());
            }
            listData.add(dto);
        }
        return listData;
    }

    @Override
    public List<BCategory> searchDeptList(BCategory BCategory) {
        return null;
    }

    @Override
    public Integer findMaxSort(BCategory BCategory) {
        return null;
    }

    @Override
    public void checkDeptNameUnique(BCategory BCategory) {

    }

    @Override
    public List<TreeNode> buildDeptTree(int level, String id) {
        return null;
    }

    @Override
    public List<TreeNode> search(String deptName) {
        return null;
    }

    @Override
    public List<TreeNode> buildDeptTreeExcludeChild(int i, String id, String excludeId) {
        return null;
    }

    @Override
    public Object selectDeptListByRoleId(String roleId) {
        return null;
    }

    @Override
    public List<TreeNode> buildDeptSelectUserTree(int level, String id) {
        return null;
    }

    @Override
    public List<TreeNode> searchDeptUserList(BCategory BCategory) {
        return null;
    }

    @Override
    public List<Map<String, Object>> getDeptInfoByIds(JSONObject deptIdsObj) {
        return null;
    }

    @Override
    public void refreshCache() {

    }
}